<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:s="http://jboss.com/products/seam/taglib"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:rich="http://richfaces.org/rich">
    <ui:repeat var="_page" value="#{parentPages}">
        <li class="page #{_page.id eq pageHome.id ? 'current' : ''}">
            <span>
                <s:link value="#{_page.title}"
                        view="/page.xhtml"
                        title="#{_page.title}"
                        propagation="none">
                    <f:param name="pageId" value="#{_page.id}"/>
                </s:link>
            </span>
        </li>
    </ui:repeat>
    <li class="products">
            <span>
                <s:link value="#{messages.products}"
                        view="/products.xhtml"
                        title="#{messages.products}"
                        propagation="none">
                    <f:param name="pageId" value="#{_page.id}"/>
                </s:link>
            </span>
        </li>
    <li class="login">
        <span>
            <s:link rendered="#{!identity.loggedIn}"
                    value="Log In"
                    view="/login.xhtml">
            </s:link>
            <h:commandLink rendered="#{identity.loggedIn}"
                            value="Log out"
                        action="#{identity.logout}"/>
        </span>
    </li>
    <f:subview id="createpage"
               rendered="#{identity.hasRole('admin')}">
        <li class="createpage">
            <span>
                <s:link value="Create page"
                        view="/view/page/crud.xhtml"
                        propagation="none" />
            </span>
        </li>
        <li class="fileupload">
            <span>
                <s:link value="Upload files"
                        view="/view/fileupload/upload.xhtml"
                        propagation="none" />
            </span>
        </li>
    </f:subview>
</ui:composition>
